﻿using Photon.SocketServer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;
using Common.Tools;
namespace MyGameServer.Handler
{
    public class SyncPostionHanlder : BaseHandler
    {

        public SyncPostionHanlder() 
        {
            OpCode = OperationCode.SyncPostion;
        }

        public override void OnOPerationRequest(OperationRequest operationRequest, SendParameters sendParameters, ClientPeer peer)
        {
            // Vector3Data pos = (Vector3Data)DicTool.GetValue<byte, object>(operationRequest.Parameters, (byte)ParameterCode.Postion);

            float posx = (float)DicTool.GetValue<byte, object>(operationRequest.Parameters, (byte)ParameterCode.PostionX);
            float posy = (float)DicTool.GetValue<byte, object>(operationRequest.Parameters, (byte)ParameterCode.PostionY);
            float posz = (float)DicTool.GetValue<byte, object>(operationRequest.Parameters, (byte)ParameterCode.PostionZ);
            // MyGameServer.log.Info(posx + "  "+ posy + "  "+ posz);
            peer.x = posx;
            peer.y = posy;
            peer.z = posz;
        }
    }
}
